# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=rust-script
pkgver=0.35.0
pkgrel=0
pkgdesc="Run Rust files and expressions as scripts without any setup or compilation step"
url="https://rust-script.org/"
license="Apache-2.0 OR MIT"
# loongarch64: blocked by libc crate
arch="all !armhf !loongarch64" # tests hang
makedepends="cargo cargo-auditable"
source="https://github.com/fornwall/rust-script/archive/$pkgver/rust-script-$pkgver.tar.gz"
options="net"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
69dc51c33e926a843b3f235463922155bf90432537e7aeece69b5936789bd61d46e25fdf6d479f79fe7e290ad6296f7050e32c35f1b226dd82977d539e4f57e0  rust-script-0.35.0.tar.gz
"
